import { Component, OnInit, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { Router } from '@angular/router';
import { LoginService } from '../../../../modules/login/services/login.service';

@Component({
  selector: 'app-license-expired-alert',
  templateUrl: './license-expired-alert.component.html',
  styleUrls: ['./license-expired-alert.component.scss']
})
export class LicenseExpiredAlertComponent implements OnInit {
  uid: number;
  
  constructor(
    private router: Router,
    public dialogRef: MatDialogRef<LicenseExpiredAlertComponent>,
    @Inject(MAT_DIALOG_DATA) public data: any,
    private loginService: LoginService,
  ) { }

  async ngOnInit() {
  }

  onOk() {
    this.dialogRef.close();
    this.router.navigateByUrl('/settings')
  }

  logout() {
    this.loginService.Logout();
    location.reload();
  }
}
